/**
 * 项目示例-列表表头
 * Date 2023-5-25 09:33:56
 * 可选参数可参考：https://element-plus.org/zh-CN/component/table.html#table-column-属性
 */

import { TableColumnCtx } from 'element-plus'

interface ExampleListItem {
  device: string;
  problem: string;
  tree: string;
  date1: string;
}
export const checkInyColumns = [
  { prop: 'checkIn', label: '开放值机柜台', sortable: true, minWidth: 120, align: 'center' },
  { prop: 'count', label: '排队人数', sortable: true, minWidth: 100, align: 'center' },
  { prop: 'action', label: '监控画面', width: 100, align: 'center' }
]
export const greyListColumns = [
  { type: 'selection', width: 60 },
  { prop: 'id', label: '序号', width: 60, align: 'center' },
  { prop: 'name', label: '姓名', width: 100, align: 'center' },
  { prop: 'age', label: '年龄', sortable: true, minWidth: 60, align: 'center' },
  { prop: 'sex', label: '性别', minWidth: 60, align: 'center' },
  { prop: 'idCard', label: '身份证号', sortable: true, minWidth: 180, align: 'center' },
  { prop: 'faceInfo', label: '人脸信息', minWidth: 120, align: 'center' },
  { prop: 'inputTime', label: '录入时间', sortable: true, minWidth: 120, align: 'center' },
  { prop: 'action', label: '操作', width: 150, align: 'center' }
]
export const thresholdListColumns = [
  { prop: 'id', label: '序号', width: 60, align: 'center' },
  { prop: 'area', label: '区域', width: 80, align: 'center' },
  { prop: 'historicalAverage', label: '历史平均值', minWidth: 100, align: 'center' },
  { prop: 'isAlarm', label: '是否报警', minWidth: 100, align: 'center' },
  { prop: 'setThreshold', label: '设置阈值', minWidth: 100, align: 'center' }
]
export const mapListColumns = [
  { type: 'selection', width: 60 },
  { prop: 'id', label: '序号', width: 60, align: 'center' },
  { prop: 'deviceID', label: '设备编号', sortable: true, width: 130, align: 'center' },
  { prop: 'deviceType', label: '设备类型', minWidth: 130, align: 'center' },
  { prop: 'deviceName', label: '设备名称', sortable: true, minWidth: 200, align: 'center' },
  { prop: 'deviceModel', label: '设备型号', minWidth: 120, align: 'center' },
  { prop: 'useDepartment', label: '使用部门', minWidth: 120, align: 'center' },
  { prop: 'subsidiary', label: '归属单位', minWidth: 120, align: 'center' },
  { prop: 'place', label: '位置', width: 210, align: 'center' },
  { prop: 'position', label: '地图坐标', width: 210, align: 'center' },
  { prop: 'action', label: '操作', width: 210, align: 'center' }
]
export const demoColumns = [
  { type: 'selection', width: 60 },
  { type: 'index', label: '序号', width: 60, align: 'center' },
  { prop: 'project', label: '设备类型', minWidth: 130, align: 'center' },
  { prop: 'flightDate', label: '航班日期', minWidth: 200, align: 'center' },
  { prop: 'time1', label: '原定出发时间', minWidth: 120, sortable: true, align: 'center' },
  // 注意，需要显示时间差的字段需要手动添加一个diff属性，其值为0时就显示时间差
  // startTime属性对应为[原定出发时间]的原始字段名称，示例中显示数据的字段名称为 time1，实际字段名称为oldtime1， 实际开发中根据json结构进行修改
  // endTime[延后出发时间]的原始字段名称，示例中显示数据的字段名称为 time2，实际字段名称为oldtime2， 实际开发中根据json结构进行修改
  { prop: 'time2', label: '延后出发时间', minWidth: 120, sortable: true, align: 'center', diff: '0', startTime: 'oldtime1', endTime: 'oldtime2' },
  {
    prop: 'creator',
    label: '创建人',
    align: 'center',
    formatter: function (row:ExampleListItem, column:TableColumnCtx<ExampleListItem>, cellValue:string) {
      return cellValue + '111'
    }
  },
  { prop: 'action', label: '操作', fixed: 'right', width: 210, align: 'center' }
]
export const exampleColumns = [
  { type: 'selection', width: 60 },
  { type: 'index', label: '序号', width: 60, align: 'center' },
  { prop: 'project', label: '设备类型', minWidth: 130, align: 'center' },
  { prop: 'area', label: '区域', minWidth: 130, align: 'center' },
  { prop: 'problemType', label: '问题类型', minWidth: 200, align: 'center' },
  { prop: 'organ', label: '所属单位', minWidth: 120, sortable: true, align: 'center' },
  { prop: 'state', label: '状态', minWidth: 120, sortable: true, align: 'center' },
  { prop: 'process', label: '过程', minWidth: 120, sortable: true, align: 'center' },
  {
    prop: 'creator',
    label: '创建人',
    align: 'center',
    formatter: function (row:ExampleListItem, column:TableColumnCtx<ExampleListItem>, cellValue:string) {
      // console.log(row, column, cellValue, '111111')
      return cellValue + '111'
    }
  },
  { prop: 'createTime', label: '创建时间', sortable: true, minWidth: 180, align: 'center' },
  { prop: 'action', label: '操作', fixed: 'right', width: 210, align: 'center' }
]
